#summary sample .dhexviewrc file

{{{
-- This is a sample .dhexviewrc file.
--
--
-- exported things:
--
-- functions:
--      options
--      color_rule
--      read
--
-- global variables:
--      filename
--

-- Some global options:
options {
    use_color = true,
    hlsearch = true,
    colored_pane = "both",
}

-- This is where I store syntax files:
home = os.getenv("HOME") .. "/.dhexview-colors/"

-- auto-detect file type, based on filename or file content.
--
buf = read(0, 0x1000)

-- silly, but workable, example
if buf:find("ustar") then
    dofile(home .. "tar.lua")
elseif filename == "/etc/passwd" then
    color_rule {
        type = "exact_string",
        str = { 0xA },
        colors = {{ from = 0, to = 1, bg = "red", fg = "white", },},
    }
end

-- vim:ft=lua:

}}}